<?php
$this->Html->addCrumb('Blog','/blogs');
$this->Html->addCrumb('Detail Post');
?>
<div class="mdl-con" style="width: 846px;">
  <div class="porduct-con1">
<h2 style=" color: #0066CC;font-size: 19px;font-weight: normal;margin: 0 0 20px;">Detail Post</h2>
<h2><?php
        echo $blog['Blog']['title'];
?></h2>
<div style="font-size: 12px;margin: 0 0 8px;color: gray;">
    <?php
    echo date('F d, Y',strtotime($blog['Blog']['posting_date']));
    ?>
</div>
<br/>
<p>
  <?php
        echo $blog['Blog']['description'];
        ?>
   
</p>
<p>

    <?php
    $comments = $this->requestAction('/blogs/commentsbypost/'.$blog['Blog']['id']);
       // $j=1;
        if(!empty ($comments)){
        echo ' <br/><label style="color: #0066CC;font-size: 16px;font-weight: bold;margin-bottom: 0;">Responses:</label><br/><br/>';
        foreach($comments as $comment) {
          ?>
        <div id="comment-1" style="border-bottom:1px solid  #E7E7E7">
            <div style="color: #000000;font-style: normal;font-weight: bold;">
            Mr.  <?php
            echo $comment['User']['username'];
         ?>
             says:
         </div>
         <div class="comment-meta commentmetadata" style="font-size: 12px;margin: 0 0 8px;color: gray;">
            <?php
            echo date('F d, Y',strtotime($comment['BlogComment']['created']));
            ?> at  <?php
            echo date('g:i a',strtotime($comment['BlogComment']['created']));
            ?>
         </div>
        <div class="comment-body" style="line-height:18px;font-size: 12px;color: #333333;">
         <?php
            echo $comment['BlogComment']['comment'];
         ?>
            
        </div>
	</div>
<br/>
<?php
        
        //$j++;

        }
       }
?>
<br><br>
<?php if($session->read('Auth.User.id')!=null){?>
<div id="respond">
    <h3 id="reply-title">Leave a Reply:</h3>
    <form id="commentform" method="post" action="<?php echo Configure::read('base_url');?>blogs/view/<?php echo $id;?>">
        <p>
         <textarea aria-required="true" rows="8" cols="58" name="data[BlogComment][comment]" id="comment"></textarea>
        </p>
        <p class="form-submit">
            <input type="submit" value="Post Comment" id="submit" name="submit">            
        </p>        
    </form>
</div>
<?php
}
?>
</p>
<div class="clear"></div>
</div>
</div>
<div class="rht-con-sml">

</div>